<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html">
    <body>
        <ui:composition template="/publico/template.xhtml">
            <ui:define name="content">
                <h:form 
                    id="fprincipal">
                    <p:messages/>
                    <p:panel id="pprincipal"
                             header="Item">
                        <h:inputHidden 
                            id="ihiditem"
                            value="#{itemBean.item.id}" />

                        <h:panelGrid id="pgprincipal"
                                     columns="2">  

                            <h:outputLabel 
                                id="olnomeitem"
                                for="itnomeitem" 
                                value="Item: "/>
                            <p:inputText 
                                id="itnomeitem" 
                                value="#{itemBean.item.nome}" 
                                required="true"/>
                        </h:panelGrid>

                        <p>
                            <p:commandButton
                                id="cbsalvar"
                                ajax="false" 
                                value="Salvar" 
                                action="#{itemBean.salvar}"/>

                            <p:button id="cbcancelar"
                                      outcome="/admin/cardapio/item/lista-item.xhtml"
                                      value="Cancelar"/>
                        </p>
                    </p:panel>
                </h:form>
            </ui:define>
        </ui:composition>

    </body>
</html>
